{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 正则小游戏**http://www.heibanke.com/lesson/crawler_ex00/**"
   ]
  },
  {
   "attachments": {
    "%E5%9B%BE%E7%89%87.png": {
     "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2kAAAIBCAIAAABcOmByAAAgAElEQVR4nO3dvW4TW8M24O+c5kiI/IooJ5FEcgNIOYAtFAo3iN2kQyIFcoMEXQokBJW3tjZdOAMeiiitv8Lzs2ZmzY/NhDhZ16VbehJ7ZmxnL+L7WWvG+X+3Mf/73//WfZbzLMvmy777VotZscVynmXzxWKWzRar4tt839Vilm1uXs43X1S3rMtNZovFPJsvii+WwV31bQEA+A3/+9//ouWw9P926o4bq8Usa2o0ueU8fltxU9n+2l8EjzKbz2dhd6w9sO4IADCRO+2OgeU8i8xE5s1xGemY+eZlUyxnMuszkcUmWTZf5g9SdMeOaU8AAHb1Z7pjdAm7mBxszQtG5h037XJzhNridd4d54tVtb3uCABwN+6mO8YWq5tL18t8hbnsgWWHbHXHahoydlPrwXRHAIC7cY/zjsUds8VqvVqtqsYYn3fsrILBRTfteUctEgBgOn+kO66CFee6sCbWtm5dKzN09I55x9gDAACwmzvujvnVK7HrZMr7q2pXbV3eNrT6PVusIvOOtd1URwCAifyp66wBAHj4dEcAAMbSHQEAGEt3BABgLN0RAICxdEcAAMbSHQEAGOuuuuP/AQDwAOmOAACMpTsCADCW7ggAwFi6IwAAY+mOAACMpTsCADDWfnXHv779XK/X6+v37bveX3ff/vPbX1P+THjk/vr2sxxM5dfhjZvvasPt/fV6vb5+37odABJz793x/XX/pvk79fvr9frn9fXP5u26I1sramLH2Lt+X/yfmGBgbbrjt/fXPzv+zw0ApGE/umPHe3F1X9EQ//r2s3xD38xE6o5sI2+FZTPsmHf8v//769vPn9fvv8XrpREHQLL2pTtW79zBe3jZHd9f5+/X1UzRz2/fdEd20qyJI/cw3wgAe9Adc3/9lRfD6+vWRGS1gPj+umyQuiO7KrpjMAcZy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HvWlHRHAJjEXnVHuCvGGwBMQnckCcYbAExCdyQJxhsATEJ3JAnGGwBMQnckCcYbAExCdyQJxhsATEJ3JAnGGwBMQnckCcYbAExCdyQJxhsATEJ3JAnGGwBMQnckCcYbAExCdyQJxhsATOI+uyMAAA/O/XRHAAAeH90RAICxdEcAAMbSHQEAGEt3BABgLN0RAICxdEcAAMa6y+64nGfZbLEKv83my632ad3XcW/j2KvFrL1hdehg6+V8+DkBALBxR91xtZjNFou8rG06X81ssVotZuEt8/k8y+bLWN/sM1+u86oY3Laof59vtFoVlTLvjpvdZovFUnkEABjjjrpj0PnKJtied1wtZuUtq8WsqHUj5yrL+/J9Gt8vg4M322Wsy+7+MwQASMXddMfVYjamB4YbtGcYyynL/u64WsyKLZbzfNKxWppu7Vt7HJURAGAbd9Mdl/NsvqzNB8YWm8PJydmsNodYP1xs1rCx0XIev612U7FR0Ujz42qQAADj/MFrZcrbgpMUi7nF2sJ2X5fb9M3mbGJeCpcdK9NFT63NcZbHcLkMAMBId9gdi1m9+TzS6Kr5yNlslm2uqxmYWlx3nP5YzEq2Nu/soUMFFQCAqDs73zFfh54tVrVLYprtrz0fWMwUlsfpNVssw0u6V+XJjutaRRy8XluVBAAYNtgd/z/khCfi+7PDEwAAAABJRU5ErkJggg=="
    }
   },
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "re 正则表达式 菜鸟教程**http://www.runoob.com/python/python-reg-expressions.html**\n",
    "![%E5%9B%BE%E7%89%87.png](attachment:%E5%9B%BE%E7%89%87.png)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "base_url=\"http://www.heibanke.com/lesson/crawler_ex00/\"\n",
    "r=requests.get(base_url)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "39642\n",
      "96911\n",
      "30965\n",
      "67917\n",
      "22213\n",
      "72586\n",
      "48151\n",
      "53639\n",
      "10963\n",
      "65392\n",
      "36133\n",
      "72324\n",
      "57633\n",
      "91251\n",
      "87016\n",
      "77055\n",
      "30366\n",
      "83679\n",
      "31388\n",
      "99446\n",
      "69428\n",
      "34798\n",
      "16780\n",
      "36499\n",
      "21070\n",
      "96749\n",
      "71822\n",
      "48739\n",
      "62816\n",
      "80182\n",
      "68171\n",
      "45458\n",
      "56056\n",
      "87450\n",
      "52695\n",
      "36675\n",
      "25997\n",
      "73222\n",
      "93891\n",
      "29052\n",
      "72996\n",
      "73999\n",
      "23814\n",
      "98084\n",
      "51103\n",
      "39603\n",
      "34316\n",
      "55719\n",
      "53685\n",
      "77771\n",
      "运行了99s\n"
     ]
    }
   ],
   "source": [
    "import re\n",
    "count=1\n",
    "import time\n",
    "# import sys\n",
    "start=time.time()\n",
    "def get_next(r):\n",
    "    number=re.search(\"<h3>.|\\n*?([0-9]+).*?</h3>\",r.text).group(1)\n",
    "    global count\n",
    "    count+=1\n",
    "#     print(count)\n",
    "    print(number)\n",
    "    url=base_url+number\n",
    "    return url\n",
    "while True:\n",
    "    try:\n",
    "        url=get_next(r)\n",
    "        r=requests.get(url)\n",
    "    except:\n",
    "        end_time=time.time()\n",
    "        print(\"运行了%ds\"%(end_time-start))\n",
    "        break\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
